package com.xiangban.service.fallback;

import com.xiangban.model.TSystem;
import com.xiangban.model.TSystemConfig;
import com.xiangban.model.res.ApiResult;
import com.xiangban.service.fegin.SystemServiceFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class SystemServiceFallback implements FallbackFactory<SystemServiceFeign> {


    @Override
    public SystemServiceFeign create(Throwable throwable) {
        return new SystemServiceFeign() {
            @Override
            public ApiResult<TSystem> selectSystemByAccessId(TSystem tSystem) {
                return ApiResult.newError("获取系统列表失败");
            }

            @Override
            public ApiResult<TSystemConfig> getSystemConfigByAccessId(TSystem tSystem) {
                return  ApiResult.newError("获取系统配置信息失败");
            }

        };
    }
}
